//猜测：该文件仅在生产环境下，生效

import {createProdMockServer} from 'vite-plugin-mock/es/createProdMockServer'
//https://cn.vitejs.dev/guide/features.html#glob-import
// @ts-ignore
const modulesFiles=import.meta.glob('../mock/*',{eager:true})

let modules=[]
for (const filepath in modulesFiles) {
  modules=modules.concat(modulesFiles[filepath].default)
}

export function setupProdMockServer(){
  //创建prod mock server
  createProdMockServer([...modules])
}
